<%@ page import="com.portico.dept.solarch.ProjectDashboard" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="thin"/>
    <g:set var="entityName" value="${message(code: 'projectDashboard.label', default: 'ProjectDashboard')}"/>
    <title><g:message code="default.create.label" args="[entityName]"/></title>
</head>

<body>

<div class="body">
    <h1><g:message code="default.create.label" args="[entityName]"/></h1>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${projectDashboardInstance}">
        <div class="errors">
            <g:renderErrors bean="${projectDashboardInstance}" as="list"/>
        </div>
    </g:hasErrors>
    <g:formRemote name="createDashboard"
                  url="[controller:'projectDashboard', action:'remote_save' ]" update="result">
        <div id="result">
            <div class="dialog">
                <table>
                    <tbody>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="trend"><g:message code="projectDashboard.trend.label" default="Trend"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'trend', 'errors')}">
                            <g:select name="trend" from="${projectDashboardInstance.constraints.trend.inList}"
                                      value="${projectDashboardInstance?.trend}"
                                      valueMessagePrefix="projectDashboard.trend"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="currentStatus"><g:message code="projectDashboard.currentStatus.label"
                                                                  default="Current Status"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'currentStatus', 'errors')}">
                            <g:select name="currentStatus"
                                      from="${projectDashboardInstance.constraints.currentStatus.inList}"
                                      value="${projectDashboardInstance?.currentStatus}"
                                      valueMessagePrefix="projectDashboard.currentStatus"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="budget"><g:message code="projectDashboard.budget.label"
                                                           default="Budget"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'budget', 'errors')}">
                            <g:select name="budget" from="${projectDashboardInstance.constraints.budget.inList}"
                                      value="${projectDashboardInstance?.budget}"
                                      valueMessagePrefix="projectDashboard.budget"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="resources"><g:message code="projectDashboard.resources.label"
                                                              default="Resources"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'resources', 'errors')}">
                            <g:select name="resources" from="${projectDashboardInstance.constraints.resources.inList}"
                                      value="${projectDashboardInstance?.resources}"
                                      valueMessagePrefix="projectDashboard.resources"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="timeline"><g:message code="projectDashboard.timeline.label"
                                                             default="Timeline"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'timeline', 'errors')}">
                            <g:select name="timeline" from="${projectDashboardInstance.constraints.timeline.inList}"
                                      value="${projectDashboardInstance?.timeline}"
                                      valueMessagePrefix="projectDashboard.timeline"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="quality"><g:message code="projectDashboard.quality.label"
                                                            default="Quality"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'quality', 'errors')}">
                            <g:select name="quality" from="${projectDashboardInstance.constraints.quality.inList}"
                                      value="${projectDashboardInstance?.quality}"
                                      valueMessagePrefix="projectDashboard.quality"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="scope"><g:message code="projectDashboard.scope.label" default="Scope"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'scope', 'errors')}">
                            <g:select name="scope" from="${projectDashboardInstance.constraints.scope.inList}"
                                      value="${projectDashboardInstance?.scope}"
                                      valueMessagePrefix="projectDashboard.scope"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="voc"><g:message code="projectDashboard.voc.label" default="Voc"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'voc', 'errors')}">
                            <g:select name="voc" from="${projectDashboardInstance.constraints.voc.inList}"
                                      value="${projectDashboardInstance?.voc}"
                                      valueMessagePrefix="projectDashboard.voc"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="comments"><g:message code="projectDashboard.comments.label"
                                                             default="Comments"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'comments', 'errors')}">
                            <g:textArea name="comments" cols="40" rows="5"
                                        value="${projectDashboardInstance?.comments}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="project"><g:message code="projectDashboard.project.label"
                                                            default="Project"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectDashboardInstance, field: 'project', 'errors')}">
                            <g:select name="project.id" from="${com.portico.dept.solarch.Project.list()}" optionKey="id"
                                      value="${projectDashboardInstance?.project?.id}"/>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>

            <div class="buttons">
                <span class="button"><g:submitButton name="create" class="save"
                                                     value="${message(code: 'default.button.create.label', default: 'Create')}"/></span>
            </div>
        </div>
    </g:formRemote>
</div>
</body>
</html>
